package lib.bone.access.module.oss.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;

/**
 * @author: kindear
 */
@Data
@Entity
@Table(name = "nepu_research_file")
@EntityListeners(AuditingEntityListener.class)
@ApiModel(value = "科研项目关联文件")
@GenericGenerator(name = "jpa-uuid", strategy = "uuid")
public class NepuResearchFile {
    @Id
    @GeneratedValue(generator = "jpa-uuid")
    @ApiModelProperty(value = "科研项目关联文件记录ID",name = "id")
    String id;
    /**
     * 根据科研项目类型不同，判断不同查询
     */
    @ApiModelProperty(value = "科研类型",notes = "科研类型：论文、成果转化，纵向课题，著作教材，教学科研获奖，知识产权，横向课题，智库类成果")
    @Column(name = "research_type")
    String researchType;

    /**
     * 关联科研项目ID
     */
    @ApiModelProperty(value = "关联科研项目ID",notes = "根据科研项目类型不同，对应不同的表")
    @Column(name = "mapper_id")
    String mapperId;

    /**
     * 关联文件ID
     */
    @ApiModelProperty(value = "关联文件ID",notes = "")
    @Column(name = "file_id")
    String fileId;

    @CreatedDate
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @ApiModelProperty(value = "记录创建时间",name = "createdTime")
    @Column(name = "created_time")
    private Date createdTime;
    @LastModifiedDate
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @ApiModelProperty(value = "记录更新时间",name = "updatedTime")
    @Column(name = "updated_time")
    private Date updatedTime;
}
